﻿package mortal.game.view.copy.singleTowerCopy2.data
{
    import Message.DB.Tables.*;
    import flash.utils.*;
    import mortal.game.cache.*;
    import mortal.game.resource.*;
    import mortal.game.resource.tableConfig.*;
    import mortal.game.view.copy.GroupTowerCopy.data.*;

    public class SingleTowerCopyUtil extends Object
    {
        public static var curLv:int = 1;
        public static var curCode:int = 146;
        private static var _copyCodeArr:Array = [146, 147, 148, 149];
        public static const oneDayTotalNum:int = 3;

        public function SingleTowerCopyUtil()
        {
            return;
        }// end function

        public static function getFirstRwArrByCodeAndLv(param1:int, param2:int) : Array
        {
            var _loc_5:String = null;
            var _loc_3:Array = [];
            var _loc_4:* = TowerCopyConfig.instance.getInfoByID(param1, param2);
            if (_loc_4)
            {
                _loc_5 = _loc_4.rewards;
                _loc_3 = RewardCfgUtil.getItemDatasByStr(_loc_5);
            }
            return _loc_3;
        }// end function

        public static function showFirstRw(param1:int, param2:int) : Array
        {
            var _loc_4:Array = null;
            var _loc_3:* = Cache.instance.copy.groupTower.singleFtRwDic[param1];
            if (_loc_3 == null || _loc_3[param2] == null)
            {
                _loc_4 = getFirstRwArrByCodeAndLv(param1, param2);
                return _loc_4;
            }
            return null;
        }// end function

        public static function getComRwArrByCodeAndLv(param1:int, param2:int) : Array
        {
            var _loc_5:String = null;
            var _loc_3:Array = [];
            var _loc_4:* = TowerCopyConfig.instance.getInfoByID(param1, param2);
            if (_loc_4)
            {
                _loc_5 = _loc_4.repeateRewards;
                _loc_3 = RewardCfgUtil.getItemDatasByStr(_loc_5);
            }
            return _loc_3;
        }// end function

        public static function getTotalLvByCode(param1:int) : int
        {
            var _loc_2:* = CopyConfig.instance.getCopyInfoByCode(param1);
            if (_loc_2)
            {
                return _loc_2.maps.split("#").length;
            }
            return 20;
        }// end function

        public static function getCopyCodeByTaBIndex(param1:int) : int
        {
            return _copyCodeArr[param1];
        }// end function

        public static function getCanGetInLvByIndex(param1:int) : int
        {
            var _loc_2:* = Cache.instance.copy.groupTower.singleGanInfo.passMaxLevel[param1] as int;
            return _loc_2;
        }// end function

        public static function isEnterTimeEnogth() : Boolean
        {
            return Cache.instance.copy.groupTower.singleGanInfo.todayPassNum < oneDayTotalNum;
        }// end function

    }
}
